The Different Aspects of Monads and Mixins
نویسنده
چکیده
Around twenty years ago two important developments happened in the areas of modularity and reuse in programming languages. On the one hand, Moggi showed how computational effects found in impure languages could be simulated using the notion of monads from category theory. Inspired by Moggi’s work, Wadler showed how monads could be used to structure (purely functional) programs. On the other hand, work by Cook showed how variations of mixins could model different notions of inheritance (normally found in object-oriented languages) in simple, elegant and compositional ways, by using traditional techniques of fixed-point theory. Monads and mixins are helpful to handle different aspects of modularity and reuse in programming languages, yet they have been largely explored independently. In this paper we show that the combination of monads and mixins leads to a simple aspectoriented programming (AOP) style that can be used effectively in purely functional programming languages to write elegant, reusable and modular programs.
منابع مشابه
Leibniz’s Monads and Mulla Sadra’s Hierarchy of Being: A Comparative Study
Mulla Sadra and Leibniz, the two philosophers from the East and the West, belong to two different worlds. Though they were unaware of the ideas of each other, their philosophical systems share certain common points that are comparable. Monads constitute the basis of Leibniz's thought and he refers to their features in his various works. On the other side, Mulla Sadra's philosophy is also based ...
متن کاملObject-based and class-based composition of transitive mixins
In object-oriented composition, classes and class inheritance are applied to realize type relationships and reusable building blocks. Unfortunately, these two goals might be contradictory in many situations, leading to classes and inheritance hierarchies that are hard to reuse. Some approaches exist to remedy this problem, such as mixins, aspects, roles, and meta-objects. However, in all these ...
متن کاملUsing Mixin Technology to Improve Modularity
In object-oriented languages, aspects can be defined by generalizing the idea of a class to that of a mixin. Mixins, which can be implemented as generic types, become aspects when they contain code for multiple classes. In this chapter, we describe mixins and we explain how mixins can be used to define aspects. We demonstrate the flexibility of mixin programming by prototyping a graphical user ...
متن کاملAspect-Oriented Development Using Protocol Modeling
The aim of this paper is to explore the modeling of crosscutting behavioral abstractions. We argue that behavioral aspects can be seen as a particular kind of more general behavioral abstraction called a “mixin”. Mixins support a compositional style of modeling, whereby a complete class definition is constructed by composing one or more mixins each of which represents a partial definition of th...
متن کاملApplications of the Kleisli and Eilenberg-Moore 2-adjunctions
In 2010, J. Climent Vidal and J. Soliveres Tur developed, among other things, a pair of 2-adjunctions between the 2-category of adjunctions and the 2-category of monads. One is related to the Kleisli adjunction and the other to the Eilenberg-Moore adjunction for a given monad.Since any 2-adjunction induces certain natural isomorphisms of categories, these can be used to classify bijection...
متن کاملذخیره در منابع من
با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید
عنوان ژورنال:
دوره شماره
صفحات -
تاریخ انتشار 2007